<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
    <head>
        <title>JSTL</title>
    </head>
    <body>
        <h3>Java Standard Tag Library</h3>
        <div class="wrapper">
            <h4>核心标签(也称作c标签)</h4>
            <div>
                <p>&lt;c:set&gt; 、&lt;c:if&gt; 、&lt;c:redirect&gt;</p>
                <form action="/tags/login.jsp" method="post">
                    登录名称: <input type="text" name="username">
                    登录密码: <input type="password" name="password">
                    <button type="submit">登录</button>
                </form>
            </div>
            <div>
                <p>&lt;c:choose&gt; 、&lt;c:when&gt; 、&lt;c:otherwise&gt;</p>
                <form action="/tags/sign-in.jsp" method="post">
                    <%-- 用 value 属性接收从 session 取得的属性值 --%>
                    登录名称: <input type="text" name="username" value="${username}">
                    <c:remove var="username" scope="session" />
                    登录密码: <input type="password" name="password">
                    <button type="submit">登录</button>
                </form>
                <%-- 先显示错误提示信息 --%>
                <p>${ message }</p>
                <%-- session.removeAttribute( "message" ) --%>
                <c:remove var="message" scope="session" />
            </div>
            <div>
                <a href="/prepare">&lt;c:forEach&gt;</a>
            </div>
        </div>

        <div class="wrapper">
            <h4>格式化标签(也称作fmt标签)</h4>
            <ul>
                <li>
                    <a href="/tags/format.jsp">
                        &lt;fmt:formatDate&gt;、&lt;fmt:parseDate&gt;、&lt;fmt:formatNumber&gt;、&lt;fmt:parseNumber&gt;
                    </a>
                </li>
                <li>
                    <a href="/tags/i18n.jsp?locale=zh_CN">中文</a>
                    <a href="/tags/i18n.jsp?locale=en_US">英文</a>
                </li>
            </ul>
        </div>

        <div class="wrapper">
            <h4>标准函数库</h4>
            <p>
                <a href="/tags/functions.jsp">函数</a>
            </p>
        </div>
    </body>
</html>
